﻿@namespace ThingsGateway.Gateway.Razor
@using ThingsGateway
@using ThingsGateway.Authentication
@if (WebsiteOption.Value.ShowAuthorize)
{

    <Card class="h-100">
        <BodyTemplate>
            <div class="ma-1">
                <div class="row g-3 form-inline">
                    <div class="col-12 col-sm-12">

                        <label class="form-label">

                            @Localizer["UUID"]
                        </label>
                        @if (AuthorizeInfo != null)
                        {
                            <Textarea Value="@AuthorizeInfo.Uuid" rows="5" />
                        }
                    </div>
                </div>

                <PopConfirmButton Size="Size.Small" Color="Color.Success" Icon="fa-solid fa-bars" Text="@Localizer["Register"]" IsAsync OnConfirm="Register">

                    <BodyTemplate>
                        <Textarea rows="10" @bind-Value=Password ShowLabel="true" ShowLabelTooltip="true" />
                    </BodyTemplate>

                </PopConfirmButton>

            </div>

            <div class="ma-1 mt-4">

                <div class="row g-3 form-inline">
                    <div class="col-12 col-sm-12">

                        <label class="form-label">

                            @Localizer["RegisterStatus"]
                        </label>

                        <label class="form-control">
                            @(AuthorizeInfo?.Auth == true ? Localizer["Authorized"] : Localizer["Unauthorized"])
                        </label>
                    </div>
                </div>
            </div>
            <div class="ma-1">

                @if (AuthorizeInfo != null)
                {
                    <div class="row g-3 form-inline">

                        <div class="col-12 col-sm-12">

                            <label class="form-label">

                                @Localizer["AuthName"]
                            </label>

                            <label class="form-control">
                                @AuthorizeInfo?.AuthName
                            </label>
                        </div>

                        <div class="col-12 col-sm-12">

                            <label class="form-label">

                                @Localizer["ExpireTime"]
                            </label>

                            <label class="form-control">
                                @AuthorizeInfo?.RealExpireTime
                            </label>
                        </div>

                        <div class="col-12 col-sm-12">

                            <label class="form-label">

                                @Localizer["MaxChannelCount"]
                            </label>

                            <label class="form-control">
                                @AuthorizeInfo?.MaxChannelCount
                            </label>
                        </div>

                        <div class="col-12 col-sm-12">

                            <label class="form-label">

                                @Localizer["MaxDeviceCount"]
                            </label>

                            <label class="form-control">
                                @AuthorizeInfo?.MaxDeviceCount
                            </label>
                        </div>

                        <div class="col-12 col-sm-12">

                            <label class="form-label">

                                @Localizer["MaxVariableCount"]
                            </label>

                            <label class="form-control">
                                @AuthorizeInfo?.MaxVariableCount
                            </label>
                        </div>
                    </div>
                }

            </div>
        </BodyTemplate>

    </Card>

}



